from selenium import webdriver
from selenium.webdriver.firefox.service import Service

# 请替换为你实际的 GeckoDriver 路径
geckodriver_path = '/Users/lidongxiao/Downloads/geckodriver'
service = Service(geckodriver_path)

driver = webdriver.Firefox(service=service)
# driver = webdriver.Firefox()
try:
    driver.get('https://www.baidu.com')
    input("按回车键退出...")
finally:
    driver.quit()